<script>
  let obj = {
    a: {
      b: {
        c: 1,
        cc: {
          dd: {
            f: 'f Val'
          }
        }
      }
    },
    data: {
      v1: 'v1',
      v2: 'v2',
      v3: 'v3'
    }
  }

  console.log(getDeepObjAttr(obj, 'a.b.cc.dd.f'))
  // deep get Object Attribute
  function getDeepObjAttr(obj, deepPath) {
    const deepGet = (o, paths) => {
      if (!paths.length) return o
      return deepGet(Reflect.get(o, paths.shift()), paths)
    }
    return deepGet(obj, deepPath.split('.'))
  }

  setDeepObjAttr(obj, 'a.b.c', '2')
  setDeepObjAttr(obj, 'a.b.cc.dd.f', 'f Val21')
  // deep set Object Attribute 

  function setDeepObjAttr(model, deepPath, val) {
    let paths = deepPath.split('.')
    if (!paths.length) return model
    const setDeep = (o, p, i) => {
      if (i < 0) return o
      let prop = p[i]
      // 最后一层要设定的值
      if (i === p.length - 1) {
        Reflect.set(o, prop, val)
      } else {
        Reflect.set(o, prop, {
          ...getDeepObjAttr(model, p.slice(0, i + 1).join('.')),
          ...o
        })
        Reflect.deleteProperty(o, paths[i + 1])
      }
      return setDeep(o, p, --i)
    }
    return Object.assign(model,
      setDeep({}, [...paths], paths.length - 1)
    )
  }

  setDeepObjAttr(obj, 'data.v1', 'v11')
  console.log(obj); //sy-log
</script>